<?php

namespace App\Transformers;

use App\Models\Product;
use League\Fractal\TransformerAbstract;

class ProductTransformer extends TransformerAbstract
{
    
    /*protected $availableIncludes = ['type'];
    
    public function  includeType(Product $product)
    {
         return $this->item($product->type, new TypeTransformer());
    }*/
    
    
    public function transform(Product $Product)
    {
        return [
            'id' => $Product->id,
            'pro_name' => $Product->pro_name,
            'title' => $Product->title,
            'content'=>$Product->content,
            'img'=>$Product->img,
            'is_del'=>$Product->is_del,
            'pid'=>$Product->pid,
        ];
    }
}